/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

import java.util.ArrayList;

/**
 *
 * @author Snowangelic
 */
public class Custom extends Clusterization {

    ArrayList<Integer>[] actionArray;
    Custom(CustomOptions opt){
        Clusterization(opt);
        this.actionArray=opt.actionArray;
        compute();
    }

    @Override
    public ArrayList<Weight> getWeightList() {
        ArrayList<Weight> fakeWeightList=new ArrayList<Weight>();
        for(int i=0;i<dataSet.getAttributeNbr();i++){
            Weight fakeWeight=new Weight(dataSet.getAttribute(i),1);
            fakeWeightList.add(fakeWeight);
        }
        return fakeWeightList;
    }

    @Override
    public boolean getNormalized() {
        return true;
    }

    @Override
    public Distance getDistance() {
        return Distance.EUCLIDIAN;
    }

    @Override
    public void compute() {
        for(int i=0;i<clusterList.size();i++){
            for(int j=0;j<actionArray[i].size();j++){
                clusterList.get(i).addAction(dataSet.getAction(actionArray[i].get(j)));
                System.out.println("Adding action "+actionArray[i].get(j)+" to cluster nbr "+i);
            }
            clusterList.get(i).recomputePosition();
        }
    }

}
